<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>HBase的伸缩性和可用性 | 袖清暮雨` Blog</title><meta name="author" content="袖清暮雨"><meta name="copyright" content="袖清暮雨"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="ffffff"><meta name="description" content="伸缩性1.”伸”的讲解(split)策略一：增长式分裂策略(默认)简化图如下： 过程讲解：客户端建表后，会在一台机器上有一个Region，客户端不断put数据进来。随着数据的增加，当Region达到阈值【阈值可以配置】时，会进行分裂(split)操作。 由于两个同样Region无法存在于同一个服务器上，因此需要迁移操作。由HMaster进行主导，HMaster会通知HRegionMaster将分裂">
<meta property="og:type" content="article">
<meta property="og:title" content="HBase的伸缩性和可用性">
<meta property="og:url" content="https://lemonworld.gitee.io/lemon-world/posts/87f2a73.html">
<meta property="og:site_name" content="袖清暮雨&#96; Blog">
<meta property="og:description" content="伸缩性1.”伸”的讲解(split)策略一：增长式分裂策略(默认)简化图如下： 过程讲解：客户端建表后，会在一台机器上有一个Region，客户端不断put数据进来。随着数据的增加，当Region达到阈值【阈值可以配置】时，会进行分裂(split)操作。 由于两个同样Region无法存在于同一个服务器上，因此需要迁移操作。由HMaster进行主导，HMaster会通知HRegionMaster将分裂">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gitee.com/LemonWorld/picture/raw/master/img/%E7%94%BB%E5%B8%83.png">
<meta property="article:published_time" content="2024-03-05T16:00:00.000Z">
<meta property="article:modified_time" content="2024-03-22T09:13:32.725Z">
<meta property="article:author" content="袖清暮雨">
<meta property="article:tag" content="大数据">
<meta property="article:tag" content="实时数仓">
<meta property="article:tag" content="HBase">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://gitee.com/LemonWorld/picture/raw/master/img/%E7%94%BB%E5%B8%83.png"><link rel="shortcut icon" href="/lemon-world/./img/144.png"><link rel="canonical" href="https://lemonworld.gitee.io/lemon-world/posts/87f2a73.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//fonts.googleapis.com" crossorigin=""/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="manifest" href="/lemon-world/manifest.json"/><meta name="msapplication-TileColor" content="#3b70fc"/><link rel="apple-touch-icon" sizes="180x180" href="/lemon-world/img/siteicon/128.png"/><link rel="icon" type="image/png" sizes="32x32" href="/lemon-world/img/siteicon/32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/lemon-world/img/siteicon/16.png"/><link rel="mask-icon" href="/lemon-world/img/siteicon/128.png" color="#5bbad5"/><link rel="stylesheet" href="/lemon-world/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Titillium+Web&amp;display=swap" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
  root: '/lemon-world/',
  algolia: undefined,
  localSearch: {"path":"/lemon-world/search.xml","preload":false,"top_n_per_article":1,"unescape":false,"languages":{"hits_empty":"找不到您查询的内容：${query}","hits_stats":"共找到 ${hits} 篇文章"}},
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlight.js","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":200},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: true,
    post: true
  },
  runtime: '',
  dateSuffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  infinitegrid: {
    js: 'https://cdn.jsdelivr.net/npm/@egjs/infinitegrid/dist/infinitegrid.min.js',
    buttonText: '加载更多'
  },
  isPhotoFigcaption: true,
  islazyload: true,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: true,
  },
  autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'HBase的伸缩性和可用性',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2024-03-22 17:13:32'
}</script><script>(win=>{
      win.saveToLocal = {
        set: (key, value, ttl) => {
          if (ttl === 0) return
          const now = Date.now()
          const expiry = now + ttl * 86400000
          const item = {
            value,
            expiry
          }
          localStorage.setItem(key, JSON.stringify(item))
        },
      
        get: key => {
          const itemStr = localStorage.getItem(key)
      
          if (!itemStr) {
            return undefined
          }
          const item = JSON.parse(itemStr)
          const now = Date.now()
      
          if (now > item.expiry) {
            localStorage.removeItem(key)
            return undefined
          }
          return item.value
        }
      }
    
      win.getScript = (url, attr = {}) => new Promise((resolve, reject) => {
        const script = document.createElement('script')
        script.src = url
        script.async = true
        script.onerror = reject
        script.onload = script.onreadystatechange = function() {
          const loadState = this.readyState
          if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
          script.onload = script.onreadystatechange = null
          resolve()
        }

        Object.keys(attr).forEach(key => {
          script.setAttribute(key, attr[key])
        })

        document.head.appendChild(script)
      })
    
      win.getCSS = (url, id = false) => new Promise((resolve, reject) => {
        const link = document.createElement('link')
        link.rel = 'stylesheet'
        link.href = url
        if (id) link.id = id
        link.onerror = reject
        link.onload = link.onreadystatechange = function() {
          const loadState = this.readyState
          if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
          link.onload = link.onreadystatechange = null
          resolve()
        }
        document.head.appendChild(link)
      })
    
      win.activateDarkMode = () => {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = () => {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', 'ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
        if (t === 'dark') activateDarkMode()
        else if (t === 'light') activateLightMode()
      
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
      const detectApple = () => {
        if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
          document.documentElement.classList.add('apple')
        }
      }
      detectApple()
    })(window)</script><link rel="stylesheet" href="/css/font.css"><link rel="stylesheet" href="/css/custom.css" media="defer" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.0/css/all.min.css"><!-- hexo injector head_end start --><link rel="stylesheet" href="https://cdn.cbd.int/hexo-butterfly-clock-anzhiyu@1.1.6/lib/clock.min.css" /><link rel="stylesheet" href="https://cdn.cbd.int/hexo-butterfly-wowjs/lib/animate.min.css" media="print" onload="this.media='screen'"><!-- hexo injector head_end end --><meta name="generator" content="Hexo 7.0.0"><link rel="alternate" href="/lemon-world/atom.xml" title="袖清暮雨` Blog" type="application/atom+xml">
</head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src= "" data-lazy-src="/lemon-world/./img/sanjiu.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/lemon-world/archives/"><div class="headline">文章</div><div class="length-num">39</div></a><a href="/lemon-world/tags/"><div class="headline">标签</div><div class="length-num">21</div></a><a href="/lemon-world/categories/"><div class="headline">分类</div><div class="length-num">2</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/lemon-world/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fa-solid fa-list"></i><span> 学习路线</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/lemon-world/categories/%E5%AD%A6%E4%B9%A0%E4%B8%BB%E7%BA%BF/"><span> 学习主线</span></a></li><li><a class="site-page child" href="/lemon-world/categories/%E5%AD%A6%E4%B9%A0%E6%94%AF%E7%BA%BF/"><span> 学习支线</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/lemon-world/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/lemon-world/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/lemon-world/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div><div class="menus_item"><a class="site-page" href="/lemon-world/comments/"><i class="fa-fw fa fa-paper-plane"></i><span> 留言板</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 更多</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/lemon-world/link/"><i class="fa-fw fas fa-link"></i><span> 相关链接</span></a></li><li><a class="site-page child" href="/lemon-world/picture/"><i class="fa-fw fa fa-camera-retro"></i><span> 相册</span></a></li></ul></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://gitee.com/LemonWorld/picture/raw/master/img/%E7%94%BB%E5%B8%83.png')"><nav id="nav"><span id="blog-info"><a href="/lemon-world/" title="袖清暮雨` Blog"><span class="site-name">袖清暮雨` Blog</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/lemon-world/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fa-solid fa-list"></i><span> 学习路线</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/lemon-world/categories/%E5%AD%A6%E4%B9%A0%E4%B8%BB%E7%BA%BF/"><span> 学习主线</span></a></li><li><a class="site-page child" href="/lemon-world/categories/%E5%AD%A6%E4%B9%A0%E6%94%AF%E7%BA%BF/"><span> 学习支线</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/lemon-world/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/lemon-world/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/lemon-world/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div><div class="menus_item"><a class="site-page" href="/lemon-world/comments/"><i class="fa-fw fa fa-paper-plane"></i><span> 留言板</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 更多</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/lemon-world/link/"><i class="fa-fw fas fa-link"></i><span> 相关链接</span></a></li><li><a class="site-page child" href="/lemon-world/picture/"><i class="fa-fw fa fa-camera-retro"></i><span> 相册</span></a></li></ul></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">HBase的伸缩性和可用性</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2024-03-05T16:00:00.000Z" title="发表于 2024-03-06 00:00:00">2024-03-06</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2024-03-22T09:13:32.725Z" title="更新于 2024-03-22 17:13:32">2024-03-22</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/lemon-world/categories/%E5%AD%A6%E4%B9%A0%E4%B8%BB%E7%BA%BF/">学习主线</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="leancloud_visitors" id="/lemon-world/posts/87f2a73.html" data-flag-title="HBase的伸缩性和可用性"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span class="leancloud-visitors-count"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="伸缩性"><a href="#伸缩性" class="headerlink" title="伸缩性"></a>伸缩性</h1><h2 id="1-”伸”的讲解-split"><a href="#1-”伸”的讲解-split" class="headerlink" title="1.”伸”的讲解(split)"></a>1.”伸”的讲解(split)</h2><h3 id="策略一：增长式分裂策略-默认"><a href="#策略一：增长式分裂策略-默认" class="headerlink" title="策略一：增长式分裂策略(默认)"></a>策略一：增长式分裂策略(默认)</h3><h4 id="简化图如下："><a href="#简化图如下：" class="headerlink" title="简化图如下："></a><strong>简化图如下</strong>：</h4><p><img src= "" data-lazy-src="https://gitee.com/LemonWorld/picture/raw/master/img/increasing3.0.png" alt="增长式(increasing)分裂策略"></p>
<h4 id="过程讲解："><a href="#过程讲解：" class="headerlink" title="过程讲解："></a><strong>过程讲解</strong>：</h4><p>客户端建表后，会在一台机器上有一个Region，客户端不断put数据进来。随着数据的增加，当Region达到阈值【阈值可以配置】时，会进行<strong>分裂(split)</strong>操作。</p>
<p>由于两个同样Region无法存在于同一个服务器上，因此需要迁移操作。由<strong>HMaster进行主导</strong>，<strong>HMaster会通知HRegionMaster将分裂出来的Region迁移到到哪台服务器上。</strong></p>
<p>同时<strong>HMaster会进行元数据的变更</strong>。在HMaster中的元数据记录中<strong>增加一条记录</strong>【标明Region1路径在哪台服务器上，Region2路径在哪台服务器上】</p>
<h4 id="存在缺陷："><a href="#存在缺陷：" class="headerlink" title="存在缺陷："></a><strong>存在缺陷</strong>：</h4><p>当进行数据迁移的时候，写数据会处于堵塞状态，从而产生一定的延迟。严重时甚至会导致数据的丢失。</p>
<h3 id="策略二：预分裂策略-改良版"><a href="#策略二：预分裂策略-改良版" class="headerlink" title="策略二：预分裂策略(改良版)"></a>策略二：预分裂策略(改良版)</h3><h4 id="简化图如下：-1"><a href="#简化图如下：-1" class="headerlink" title="简化图如下："></a><strong>简化图如下</strong>：</h4><p><img src= "" data-lazy-src="https://gitee.com/LemonWorld/picture/raw/master/img/%E9%A2%84%E5%88%86%E8%A3%82.png" alt="预分裂策略"></p>
<h4 id="过程讲解：-1"><a href="#过程讲解：-1" class="headerlink" title="过程讲解："></a>过程讲解：</h4><p>在写入之前，提前预估表的数据量，算出所需分区的数量。提前在RegionServer上面进行分裂操作，即：提前把空间占好。</p>
<h4 id="效果："><a href="#效果：" class="headerlink" title="效果："></a>效果：</h4><p>写性能大幅度提高，速度快。</p>
<h4 id="数据分布均匀考虑："><a href="#数据分布均匀考虑：" class="headerlink" title="数据分布均匀考虑："></a>数据分布均匀考虑：</h4><p>可以在每个Region处设定一定的范围【以关系型数据库中表的主键为例，设定主键在1~100之间的进入Region1中，主键在101~200之间的进入Region2中，主键在201~300之间的进入Region3中】，这样数据进入Region中时会均匀的分配。</p>
<h4 id="预分区的实际操作："><a href="#预分区的实际操作：" class="headerlink" title="预分区的实际操作："></a>预分区的实际操作：</h4><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">7.预分区（hbase优化）</span></span><br><span class="line">7.1、预分区</span><br><span class="line">策略一：【NUMREGIONS：分区数量；SPLITALGO：分裂所采用的算法】</span><br><span class="line">	create &quot;test_hbase:test_split&quot;,&quot;t1&quot;,&quot;t2&quot;,&#123;NUMREGIONS=&gt;3,SPLITALGO=&gt;&quot;UniformSplit&quot;&#125;</span><br><span class="line">策略二：【SPLITS：行键取值范围（字母或数字）】</span><br><span class="line"><span class="meta prompt_">	#</span><span class="language-bash"><span class="comment">##取值范围：0~100,101~200,201~300,301以上</span></span></span><br><span class="line">	create &quot;test_hbase:test_rowkey_split&quot;,&quot;cf1&quot;,&quot;cf2&quot;,SPLITS=&gt;[&quot;100&quot;,&quot;200&quot;,&quot;300&quot;]</span><br><span class="line"></span><br><span class="line">7.2、查看分区</span><br><span class="line">scan &quot;hbase:meta&quot;,&#123;STARTROW=&gt;&quot;test_hbase:test_rowkey_split&quot;,LIMIT=&gt;10&#125;</span><br><span class="line">---------------------------</span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">hdfs存储信息</span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">drwxr-xr-x	root	supergroup	0 B	Mar 11 20:31	0	0 B	.tabledesc</span>	</span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">drwxr-xr-x	root	supergroup	0 B	Mar 11 20:31	0	0 B	.tmp</span>	</span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">drwxr-xr-x	root	supergroup	0 B	Mar 11 20:31	0	0 B	28c38ce5ff401333122c00c05e521ae3</span>	</span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">drwxr-xr-x	root	supergroup	0 B	Mar 11 20:31	0	0 B	4493f765702cc8979678f14cbcff17ff</span>	</span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">drwxr-xr-x	root	supergroup	0 B	Mar 11 20:31	0	0 B	540c8c1f386356cab11f824e74d33fad</span>	</span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">drwxr-xr-x	root	supergroup	0 B	Mar 11 20:31	0	0 B	867157c4f6ab39ba52ac6b3b58e6cbf4</span></span><br><span class="line">---------------------------</span><br></pre></td></tr></table></figure>
<h2 id="2-”缩”的讲解-compact"><a href="#2-”缩”的讲解-compact" class="headerlink" title="2.”缩”的讲解(compact)"></a>2.”缩”的讲解(compact)</h2><h3 id="策略一：min-compact"><a href="#策略一：min-compact" class="headerlink" title="策略一：min_compact"></a>策略一：min_compact</h3><p><strong>具体讲解</strong>：2个小文件合并为一个大文件</p>
<h3 id="策略二：major-compact"><a href="#策略二：major-compact" class="headerlink" title="策略二：major_compact"></a>策略二：major_compact</h3><p><strong>具体讲解</strong>：所有小的文件合并为一个大文件</p>
<h3 id="必知点："><a href="#必知点：" class="headerlink" title="必知点："></a>必知点：</h3><p><strong>1.</strong>由于HBase的数据会存储于HDFS中，因此大文件(合并后文件)也是有上限的，即：一个大文件最多为128M。</p>
<p><strong>2.</strong>合并操作：<strong>将StoreFile进行合并</strong>。</p>
<h1 id="可用性"><a href="#可用性" class="headerlink" title="可用性"></a>可用性</h1><h2 id="1-容灾性"><a href="#1-容灾性" class="headerlink" title="1.容灾性"></a>1.容灾性</h2><h3 id="HRegionServer容灾"><a href="#HRegionServer容灾" class="headerlink" title="HRegionServer容灾"></a>HRegionServer容灾</h3><p>由于<strong>HLog日志文件</strong>存在,实现了<strong>WAL机制（Write Ahead Log）</strong>，即：在写入具体磁盘上之前会先写到HLog日志中去。当HRegionServer死机，异常等情况出现时，HMaster会将HLog迁移到另一台服务器上，进行恢复。</p>
<p><strong>补充知识</strong></p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">WAL机制=&gt;理论体系</span><br><span class="line">HLog=&gt;具体记录理论体系的数据载体</span><br></pre></td></tr></table></figure>
<h3 id="HMaster容灾"><a href="#HMaster容灾" class="headerlink" title="HMaster容灾"></a>HMaster容灾</h3><p>当ZooKeeper通过心跳察觉到HMaster出现问题时，会启动备用HMaster backup。因为ZooKeeper与HMaster和备用的HMaster backup之间都具有心跳。</p>
<h2 id="2-统一管理"><a href="#2-统一管理" class="headerlink" title="2.统一管理"></a>2.统一管理</h2><p>HMaster通过心跳统一管理HRegionServer。</p>
<p>ZooKeeper通过心跳统一管理HMaster及其备用HMaster backup。</p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta"><i class="fas fa-circle-user fa-fw"></i>文章作者: </span><span class="post-copyright-info"><a href="https://lemonworld.gitee.io/lemon-world">袖清暮雨</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta"><i class="fas fa-square-arrow-up-right fa-fw"></i>文章链接: </span><span class="post-copyright-info"><a href="https://lemonworld.gitee.io/lemon-world/posts/87f2a73.html">https://lemonworld.gitee.io/lemon-world/posts/87f2a73.html</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta"><i class="fas fa-circle-exclamation fa-fw"></i>版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://lemonworld.gitee.io/lemon-world" target="_blank">袖清暮雨` Blog</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/lemon-world/tags/%E5%A4%A7%E6%95%B0%E6%8D%AE/">大数据</a><a class="post-meta__tags" href="/lemon-world/tags/%E5%AE%9E%E6%97%B6%E6%95%B0%E4%BB%93/">实时数仓</a><a class="post-meta__tags" href="/lemon-world/tags/HBase/">HBase</a></div><div class="post_share"><div class="social-share" data-image="https://gitee.com/LemonWorld/picture/raw/master/img/%E7%94%BB%E5%B8%83.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/lemon-world/posts/4c9d8329.html" title="流处理(stream)与批处理(batch)讲解"><img class="cover" src= "" data-lazy-src="https://gitee.com/LemonWorld/picture/raw/master/img/%E9%BB%91%E8%89%B2%E5%9B%9B%E5%8F%B6%E8%8D%89.png" onerror="onerror=null;src='/lemon-world/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">流处理(stream)与批处理(batch)讲解</div></div></a></div><div class="next-post pull-right"><a href="/lemon-world/posts/312cba19.html" title="VMware虚拟机安装Linux(CentOS7)"><img class="cover" src= "" data-lazy-src="https://gitee.com/LemonWorld/picture/raw/master/img/%E5%A4%9C%E6%99%9A%E8%8A%B1%E7%81%AB.png" onerror="onerror=null;src='/lemon-world/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">VMware虚拟机安装Linux(CentOS7)</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/lemon-world/posts/6ea55398.html" title="大数据技术之HBase基本知识"><img class="cover" src= "" data-lazy-src="https://gitee.com/LemonWorld/picture/raw/master/img/%E9%AA%A8%E7%8E%8B.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2024-03-04</div><div class="title">大数据技术之HBase基本知识</div></div></a></div><div><a href="/lemon-world/posts/db281d8f.html" title="大数据技术之HBase操作归纳"><img class="cover" src= "" data-lazy-src="https://gitee.com/LemonWorld/picture/raw/master/img/%E9%BE%99%E4%B8%8E%E8%99%8E.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2024-03-04</div><div class="title">大数据技术之HBase操作归纳</div></div></a></div><div><a href="/lemon-world/posts/4c9d8329.html" title="流处理(stream)与批处理(batch)讲解"><img class="cover" src= "" data-lazy-src="https://gitee.com/LemonWorld/picture/raw/master/img/%E9%BB%91%E8%89%B2%E5%9B%9B%E5%8F%B6%E8%8D%89.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2024-03-06</div><div class="title">流处理(stream)与批处理(batch)讲解</div></div></a></div><div><a href="/lemon-world/posts/54849ec2.html" title="大数据之Hadoop（HDFS Java客户端操作）"><img class="cover" src= "" data-lazy-src="https://gitee.com/LemonWorld/picture/raw/master/img/%E7%8E%9B%E5%A5%87%E7%8E%9B.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2024-01-14</div><div class="title">大数据之Hadoop（HDFS Java客户端操作）</div></div></a></div><div><a href="/lemon-world/posts/aa5ee629.html" title="大数据之Hadoop（HDFS写文件）"><img class="cover" src= "" data-lazy-src="https://gitee.com/LemonWorld/picture/raw/master/img/%E5%B0%8F%E5%9F%8B.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2024-01-11</div><div class="title">大数据之Hadoop（HDFS写文件）</div></div></a></div><div><a href="/lemon-world/posts/874e14c1.html" title="大数据之Hadoop（HDFS查看用户行为日志文件）"><img class="cover" src= "" data-lazy-src="https://gitee.com/LemonWorld/picture/raw/master/img/%E5%AD%A4%E7%8B%AC%E6%91%87%E6%BB%9A.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2024-01-15</div><div class="title">大数据之Hadoop（HDFS查看用户行为日志文件）</div></div></a></div></div></div><hr class="custom-hr"/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div class="vcomment" id="vcomment"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src= "" data-lazy-src="/lemon-world/./img/sanjiu.jpg" onerror="this.onerror=null;this.src='/lemon-world/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">袖清暮雨</div><div class="author-info__description">一个技术宅的博客</div></div><div class="card-info-data site-data is-center"><a href="/lemon-world/archives/"><div class="headline">文章</div><div class="length-num">39</div></a><a href="/lemon-world/tags/"><div class="headline">标签</div><div class="length-num">21</div></a><a href="/lemon-world/categories/"><div class="headline">分类</div><div class="length-num">2</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/Lemon-World"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/Lemon-World" target="_blank" title="Github"><i class="fab fa-github" style="color: #24292e;"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">欢迎来到袖清暮雨`Blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%BC%B8%E7%BC%A9%E6%80%A7"><span class="toc-number">1.</span> <span class="toc-text">伸缩性</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-%E2%80%9D%E4%BC%B8%E2%80%9D%E7%9A%84%E8%AE%B2%E8%A7%A3-split"><span class="toc-number">1.1.</span> <span class="toc-text">1.”伸”的讲解(split)</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%AD%96%E7%95%A5%E4%B8%80%EF%BC%9A%E5%A2%9E%E9%95%BF%E5%BC%8F%E5%88%86%E8%A3%82%E7%AD%96%E7%95%A5-%E9%BB%98%E8%AE%A4"><span class="toc-number">1.1.1.</span> <span class="toc-text">策略一：增长式分裂策略(默认)</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E7%AE%80%E5%8C%96%E5%9B%BE%E5%A6%82%E4%B8%8B%EF%BC%9A"><span class="toc-number">1.1.1.1.</span> <span class="toc-text">简化图如下：</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%BF%87%E7%A8%8B%E8%AE%B2%E8%A7%A3%EF%BC%9A"><span class="toc-number">1.1.1.2.</span> <span class="toc-text">过程讲解：</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AD%98%E5%9C%A8%E7%BC%BA%E9%99%B7%EF%BC%9A"><span class="toc-number">1.1.1.3.</span> <span class="toc-text">存在缺陷：</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%AD%96%E7%95%A5%E4%BA%8C%EF%BC%9A%E9%A2%84%E5%88%86%E8%A3%82%E7%AD%96%E7%95%A5-%E6%94%B9%E8%89%AF%E7%89%88"><span class="toc-number">1.1.2.</span> <span class="toc-text">策略二：预分裂策略(改良版)</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E7%AE%80%E5%8C%96%E5%9B%BE%E5%A6%82%E4%B8%8B%EF%BC%9A-1"><span class="toc-number">1.1.2.1.</span> <span class="toc-text">简化图如下：</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%BF%87%E7%A8%8B%E8%AE%B2%E8%A7%A3%EF%BC%9A-1"><span class="toc-number">1.1.2.2.</span> <span class="toc-text">过程讲解：</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%95%88%E6%9E%9C%EF%BC%9A"><span class="toc-number">1.1.2.3.</span> <span class="toc-text">效果：</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%95%B0%E6%8D%AE%E5%88%86%E5%B8%83%E5%9D%87%E5%8C%80%E8%80%83%E8%99%91%EF%BC%9A"><span class="toc-number">1.1.2.4.</span> <span class="toc-text">数据分布均匀考虑：</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%A2%84%E5%88%86%E5%8C%BA%E7%9A%84%E5%AE%9E%E9%99%85%E6%93%8D%E4%BD%9C%EF%BC%9A"><span class="toc-number">1.1.2.5.</span> <span class="toc-text">预分区的实际操作：</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-%E2%80%9D%E7%BC%A9%E2%80%9D%E7%9A%84%E8%AE%B2%E8%A7%A3-compact"><span class="toc-number">1.2.</span> <span class="toc-text">2.”缩”的讲解(compact)</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%AD%96%E7%95%A5%E4%B8%80%EF%BC%9Amin-compact"><span class="toc-number">1.2.1.</span> <span class="toc-text">策略一：min_compact</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%AD%96%E7%95%A5%E4%BA%8C%EF%BC%9Amajor-compact"><span class="toc-number">1.2.2.</span> <span class="toc-text">策略二：major_compact</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%BF%85%E7%9F%A5%E7%82%B9%EF%BC%9A"><span class="toc-number">1.2.3.</span> <span class="toc-text">必知点：</span></a></li></ol></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%8F%AF%E7%94%A8%E6%80%A7"><span class="toc-number">2.</span> <span class="toc-text">可用性</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-%E5%AE%B9%E7%81%BE%E6%80%A7"><span class="toc-number">2.1.</span> <span class="toc-text">1.容灾性</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#HRegionServer%E5%AE%B9%E7%81%BE"><span class="toc-number">2.1.1.</span> <span class="toc-text">HRegionServer容灾</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#HMaster%E5%AE%B9%E7%81%BE"><span class="toc-number">2.1.2.</span> <span class="toc-text">HMaster容灾</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-%E7%BB%9F%E4%B8%80%E7%AE%A1%E7%90%86"><span class="toc-number">2.2.</span> <span class="toc-text">2.统一管理</span></a></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/lemon-world/posts/dc99e4b2.html" title="项目搭建之文件上传下载"><img src= "" data-lazy-src="https://gitee.com/LemonWorld/picture/raw/master/img/%E9%97%B4%E8%B0%8D%E8%BF%87%E5%AE%B6%E5%AE%B6.png" onerror="this.onerror=null;this.src='/lemon-world/img/404.jpg'" alt="项目搭建之文件上传下载"/></a><div class="content"><a class="title" href="/lemon-world/posts/dc99e4b2.html" title="项目搭建之文件上传下载">项目搭建之文件上传下载</a><time datetime="2024-04-19T16:00:00.000Z" title="发表于 2024-04-20 00:00:00">2024-04-20</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/lemon-world/posts/cca50181.html" title="项目搭建之Vue工程之路由"><img src= "" data-lazy-src="https://gitee.com/LemonWorld/picture/raw/master/img/%E5%A4%95%E9%98%B3%E4%B8%8B%E7%9A%84%E7%BA%A2%E8%B7%AF%E7%81%AF.png" onerror="this.onerror=null;this.src='/lemon-world/img/404.jpg'" alt="项目搭建之Vue工程之路由"/></a><div class="content"><a class="title" href="/lemon-world/posts/cca50181.html" title="项目搭建之Vue工程之路由">项目搭建之Vue工程之路由</a><time datetime="2024-04-11T16:00:00.000Z" title="发表于 2024-04-12 00:00:00">2024-04-12</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/lemon-world/posts/1e302926.html" title="项目搭建之前后端交互（跨域,页面跳转,Pinia）+实战"><img src= "" data-lazy-src="https://gitee.com/LemonWorld/picture/raw/master/img/%E8%BF%BD%E6%9C%88.png" onerror="this.onerror=null;this.src='/lemon-world/img/404.jpg'" alt="项目搭建之前后端交互（跨域,页面跳转,Pinia）+实战"/></a><div class="content"><a class="title" href="/lemon-world/posts/1e302926.html" title="项目搭建之前后端交互（跨域,页面跳转,Pinia）+实战">项目搭建之前后端交互（跨域,页面跳转,Pinia）+实战</a><time datetime="2024-04-10T16:00:00.000Z" title="发表于 2024-04-11 00:00:00">2024-04-11</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/lemon-world/posts/7f721cb1.html" title="项目搭建之SpringBoot基本操作归纳"><img src= "" data-lazy-src="https://gitee.com/LemonWorld/picture/raw/master/img/%E6%A1%A5%E4%B8%8B%E5%A4%95%E9%98%B3.png" onerror="this.onerror=null;this.src='/lemon-world/img/404.jpg'" alt="项目搭建之SpringBoot基本操作归纳"/></a><div class="content"><a class="title" href="/lemon-world/posts/7f721cb1.html" title="项目搭建之SpringBoot基本操作归纳">项目搭建之SpringBoot基本操作归纳</a><time datetime="2024-03-26T16:00:00.000Z" title="发表于 2024-03-27 00:00:00">2024-03-27</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/lemon-world/posts/452204e8.html" title="项目搭建之SpringBoot配置归纳"><img src= "" data-lazy-src="https://gitee.com/LemonWorld/picture/raw/master/img/%E9%AD%94%E6%B3%95%E5%B0%91%E5%A5%B3%E5%B0%8F%E5%9C%86.png" onerror="this.onerror=null;this.src='/lemon-world/img/404.jpg'" alt="项目搭建之SpringBoot配置归纳"/></a><div class="content"><a class="title" href="/lemon-world/posts/452204e8.html" title="项目搭建之SpringBoot配置归纳">项目搭建之SpringBoot配置归纳</a><time datetime="2024-03-17T16:00:00.000Z" title="发表于 2024-03-18 00:00:00">2024-03-18</time></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('https://gitee.com/LemonWorld/picture/raw/master/img/%E7%94%BB%E5%B8%83.png')"><div id="footer-wrap"><div class="copyright">&copy;2023 - 2024 By 袖清暮雨</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">welcome to <a href="https://lemonworld.gitee.io/lemon-world/">袖清暮雨</a> Blog!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/lemon-world/js/utils.js"></script><script src="/lemon-world/js/main.js"></script><script src="/lemon-world/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.min.js"></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><div class="js-pjax"><script>(() => {
  const initValine = () => {
    const valine = new Valine(Object.assign({
      el: '#vcomment',
      appId: 'lmEQpOsJf8mT3BIGHZZ7EDq4-gzGzoHsz',
      appKey: '7APMLg7dJeJb0sE6hHymEyaY',
      avatar: 'monsterid',
      serverURLs: '7frkCVvvwQAZBPCcjmeKotvz',
      emojiMaps: "",
      path: window.location.pathname,
      visitor: true
    }, null))
  }

  const loadValine = async () => {
    if (typeof Valine === 'function') initValine()
    else {
      await getScript('https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js')
      initValine()
    }
  }

  if ('Valine' === 'Valine' || !false) {
    if (false) btf.loadComment(document.getElementById('vcomment'),loadValine)
    else setTimeout(loadValine, 0)
  } else {
    window.loadOtherComment = loadValine
  }
})()</script></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/metingjs/dist/Meting.min.js"></script><div class="app-refresh" id="app-refresh" style="position: fixed;top: -2.2rem;left: 0;right: 0;z-index: 99999;padding: 0 1rem;font-size: 15px;height: 2.2rem;transition: all 0.3s ease;"><div class="app-refresh-wrap" style=" display: flex;color: #fff;height: 100%;align-items: center;justify-content: center;"><label>✨ 有新文章啦！✨  👉</label><a href="javascript:void(0)" onclick="location.reload()"><span style="color: #fff;text-decoration: underline;cursor: pointer;">点击使用</span></a></div></div><script>if ('serviceWorker' in navigator) {
if (navigator.serviceWorker.controller) {
navigator.serviceWorker.addEventListener('controllerchange', function() {
showNotification()
})
}
window.addEventListener('load', function() {
navigator.serviceWorker.register('/sw.js')
})
}
function showNotification() {
if (GLOBAL_CONFIG.Snackbar) {
var snackbarBg =
document.documentElement.getAttribute('data-theme') === 'light' ?
GLOBAL_CONFIG.Snackbar.bgLight :
GLOBAL_CONFIG.Snackbar.bgDark
var snackbarPos = GLOBAL_CONFIG.Snackbar.position
Snackbar.show({
text: '✨ 有新文章啦！✨  👉',
backgroundColor: snackbarBg,
duration: 500000,
pos: snackbarPos,
actionText: '点击使用',
actionTextColor: '#fff',
onActionClick: function(e) {
location.reload()
},
})
} else {
var showBg =
document.documentElement.getAttribute('data-theme') === 'light' ?
'#3b70fc' :
'#1f1f1f'
var cssText = `top: 0; background: ${showBg};`
document.getElementById('app-refresh').style.cssText = cssText
}
}</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/lemon-world/js/search/local-search.js"></script></div></div><!-- hexo injector body_end start --><script data-pjax>
  function butterfly_clock_anzhiyu_injector_config(){
    var parent_div_git = document.getElementsByClassName('sticky_layout')[0];
    var item_html = '<div class="card-widget card-clock"><div class="card-glass"><div class="card-background"><div class="card-content"><div id="hexo_electric_clock"><img class="entered loading" id="card-clock-loading" src= "" data-lazy-src="https://cdn.cbd.int/hexo-butterfly-clock-anzhiyu@1.1.6/lib/loading.gif" style="height: 120px; width: 100%;" data-ll-status="loading"/></div></div></div></div></div>';
    console.log('已挂载butterfly_clock_anzhiyu')
    if(parent_div_git) {
      parent_div_git.insertAdjacentHTML("afterbegin",item_html)
    }
  }
  var elist = 'null'.split(',');
  var cpage = location.pathname;
  var epage = 'all';
  var qweather_key = '8fb12d98d85c4c88831aa57a850d7b9f';
  var gaud_map_key = '70fbf493bf0d0ba744a308b047ea559e';
  var baidu_ak_key = 'undefined';
  var flag = 0;
  var clock_rectangle = '112.6534116,27.96920845';
  var clock_default_rectangle_enable = 'true';

  for (var i=0;i<elist.length;i++){
    if (cpage.includes(elist[i])){
      flag++;
    }
  }

  if ((epage ==='all')&&(flag == 0)){
    butterfly_clock_anzhiyu_injector_config();
  }
  else if (epage === cpage){
    butterfly_clock_anzhiyu_injector_config();
  }
  </script><script src="https://widget.qweather.net/simple/static/js/he-simple-common.js?v=2.0"></script><script data-pjax src="https://cdn.cbd.int/hexo-butterfly-clock-anzhiyu@1.1.6/lib/clock.min.js"></script><div class="js-pjax"><script async="async">var arr = document.getElementsByClassName('recent-post-item');
for(var i = 0;i<arr.length;i++){
    arr[i].classList.add('wow');
    arr[i].classList.add('animate__zoomIn');
    arr[i].setAttribute('data-wow-duration', '1.5s');
    arr[i].setAttribute('data-wow-delay', '200ms');
    arr[i].setAttribute('data-wow-offset', '30');
    arr[i].setAttribute('data-wow-iteration', '1');
  }</script><script async="async">var arr = document.getElementsByClassName('card-widget');
for(var i = 0;i<arr.length;i++){
    arr[i].classList.add('wow');
    arr[i].classList.add('animate__zoomIn');
    arr[i].setAttribute('data-wow-duration', '');
    arr[i].setAttribute('data-wow-delay', '200ms');
    arr[i].setAttribute('data-wow-offset', '');
    arr[i].setAttribute('data-wow-iteration', '');
  }</script><script async="async">var arr = document.getElementsByClassName('flink-list-card');
for(var i = 0;i<arr.length;i++){
    arr[i].classList.add('wow');
    arr[i].classList.add('animate__flipInY');
    arr[i].setAttribute('data-wow-duration', '3s');
    arr[i].setAttribute('data-wow-delay', '');
    arr[i].setAttribute('data-wow-offset', '');
    arr[i].setAttribute('data-wow-iteration', '');
  }</script><script async="async">var arr = document.getElementsByClassName('flink-list-card');
for(var i = 0;i<arr.length;i++){
    arr[i].classList.add('wow');
    arr[i].classList.add('animate__animated');
    arr[i].setAttribute('data-wow-duration', '3s');
    arr[i].setAttribute('data-wow-delay', '');
    arr[i].setAttribute('data-wow-offset', '');
    arr[i].setAttribute('data-wow-iteration', '');
  }</script><script async="async">var arr = document.getElementsByClassName('article-sort-item');
for(var i = 0;i<arr.length;i++){
    arr[i].classList.add('wow');
    arr[i].classList.add('animate__slideInRight');
    arr[i].setAttribute('data-wow-duration', '1.5s');
    arr[i].setAttribute('data-wow-delay', '');
    arr[i].setAttribute('data-wow-offset', '');
    arr[i].setAttribute('data-wow-iteration', '');
  }</script><script async="async">var arr = document.getElementsByClassName('site-card');
for(var i = 0;i<arr.length;i++){
    arr[i].classList.add('wow');
    arr[i].classList.add('animate__flipInY');
    arr[i].setAttribute('data-wow-duration', '3s');
    arr[i].setAttribute('data-wow-delay', '');
    arr[i].setAttribute('data-wow-offset', '');
    arr[i].setAttribute('data-wow-iteration', '');
  }</script><script async="async">var arr = document.getElementsByClassName('site-card');
for(var i = 0;i<arr.length;i++){
    arr[i].classList.add('wow');
    arr[i].classList.add('animate__animated');
    arr[i].setAttribute('data-wow-duration', '3s');
    arr[i].setAttribute('data-wow-delay', '');
    arr[i].setAttribute('data-wow-offset', '');
    arr[i].setAttribute('data-wow-iteration', '');
  }</script></div><script defer src="https://cdn.cbd.int/hexo-butterfly-wowjs/lib/wow.min.js"></script><script defer src="https://cdn.cbd.int/hexo-butterfly-wowjs/lib/wow_init.js"></script><!-- hexo injector body_end end --><script src="/lemon-world/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"tagMode":false,"debug":false,"model":{"jsonPath":"/lemon-world/live2dw/assets/koharu.model.json"},"display":{"position":"left","width":150,"height":300},"mobile":{"show":false},"log":false,"pluginJsPath":"lib/","pluginModelPath":"assets/","pluginRootPath":"live2dw/"});</script></body></html>